// @ts-ignore
/* eslint-disable */
import request from "@/util/request.ts";

/** 此处后端没有提供注释 POST /communityPost/add */
export async function addPost(
  body: API.AddCommunityPostDTO,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseLong>("/communityPost/add", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 GET /communityPost/category/statistics */
export async function getCategoryStatistics(options?: { [key: string]: any }) {
  return request<API.BaseResponseCategoryStatisticsDTO>(
    "/communityPost/category/statistics",
    {
      method: "GET",
      ...(options || {}),
    }
  );
}

/** 此处后端没有提供注释 POST /communityPost/delete/${param0} */
export async function deletePost(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.deletePostParams,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<API.BaseResponseBoolean>(`/communityPost/delete/${param0}`, {
    method: "POST",
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 GET /communityPost/get/${param0} */
export async function getPostById(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getPostByIdParams,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<API.BaseResponseCommunityPostVO>(
    `/communityPost/get/${param0}`,
    {
      method: "GET",
      params: { ...queryParams },
      ...(options || {}),
    }
  );
}

/** 此处后端没有提供注释 POST /communityPost/list */
export async function listPostByPage(
  body: API.QueryCommunityPostDTO,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponsePageCommunityPostVO>("/communityPost/list", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 POST /communityPost/update */
export async function updatePost(
  body: API.UpdateCommunityPostDTO,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean>("/communityPost/update", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}
